<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="cc.woori.mobile.bean.*" %>
<%@ page import="cc.woori.mobile.PMF" %>
<%@ page import="javax.jdo.Extent" %>
<%@ page import="javax.jdo.Query" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="com.google.appengine.api.datastore.KeyFactory" %>
<%@ page import="java.text.SimpleDateFormat" %>
<div id="listofnotes">
	<div class="toolbar">
		<a href="#" class="back" rel="external">뒤로</a>
		<h1>교회소식</h1>
	</div>
	<ul class="rounded">
	<%
    		PersistenceManager pm = PMF.get().getPersistenceManager(); 
    		try{ 

	    		Query query = pm.newQuery(NoteEntity.class);
	    		query.setOrdering("publishDate desc");
	    		query.setRange(0,30);
	    		
	    		List<NoteEntity> results = (List<NoteEntity>) query.execute();
	    		
	    		for (NoteEntity e : results) {
	    %>
		<li class="arrow"> 
			<a href="/pages/detail/noteinfo.jsp?vid=<%=KeyFactory.keyToString(e.getKey())%>" onClick="javascript: pageTracker._trackPageview('/news/detail');">
			<%=e.getTitle()%> 
			</a>
			
		</li>
	<%
    		}//end for
		}finally{
			if(pm != null){
				pm.close();
			}
		}
   	%>

	</ul>
</div>  